home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Information / WebSites / Wirenet / arexx / LogSTFax.lha / LogSTFax.rexx < prev   
OS/2 REXX Batch file  |  1998-09-15  |  2KB  |  52 lines

  1. /*
  2. $VER: LogSTFaxCalls.rexx 1.0 (14.9.98)
  3. by Neil Bothwick
  4. This logs all incoming calls to STFax, including
  5. CallerID information where available
  6. */
  7.  
  8. /* Change this to the name of your logfile */
  9. logfile = 'Logs:STFaxCalls.log'
  10. options results
  11. port = address()
  12. address command
  13.  
  14. if getclip('STFaxRingTime') = '' then call setclip('STFaxRingTime',0)
  15. if time(s) - getclip('STFaxRingTime') > 5 then call setclip('STFaxRingCount',0)
  16. call setclip('STFaxRingCount',getclip('STFaxRingCount') + 1)
  17. call setclip('STFaxRingTime',time(s))
  18.  
  19. select
  20.     /* open GUI on first ring and optionally send commands to other programs */
  21.     when getclip('STFaxRingCount') = 1 then do
  22.         address(port)
  23.         'SHOW'
  24.         address command
  25.         /* Add any commands you would like executed when the phone rings*/
  26.         /* These are the ones I use to shut off all music programs */
  27.         /*
  28.         if show('P','YACDP') = 1 then address 'YACDP' 'STOP'
  29.         if show('P','ACDPLAY') = 1 then address 'ACDPLAY' 'STOP'
  30.         'Tools:Sound/tinymidiplay'
  31.         'breakname MPEGA'
  32.         'breakname PreludeAMP'
  33.         'breakname AmigaAMP'
  34.         */
  35.         end
  36.  
  37.     /* Wait for second ring for Caller ID information to become available */
  38.     when getclip('STFaxRingCount') = 2 then do
  39.         address(port)
  40.         'GETCALLERID'
  41.         CallerNo = result
  42.         'GETCALLERNAME' CallerNo
  43.         CallerName = result
  44.         address command
  45.         'echo >>"'logfile'"' left(date('W'),3) date('N')',' time() left(CallerNo,20) CallerName
  46.         end
  47.     otherwise nop
  48.     end
  49.  
  50. exit
  51.  
  52.